package com.yfp.client.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yfp.client.domain.MarActivityClient;
import com.yfp.client.domain.vo.ClientActivityVO;
import com.yfp.client.domain.vo.CountClientActivityVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 * @description 针对表【mar_activity_client】的数据库操作Mapper
 * @createDate 2024-07-16 18:07:01
 * @Entity com.yfp.operation.domain.MarActivityClient
 */
@Mapper
public interface MarActivityClientMapper extends BaseMapper<MarActivityClient> {
    /**
     * 邀请有礼统计
     *
     * @param type
     * @param clientId
     * @return
     */
    CountClientActivityVO countClientActivityByMarketingIdAndClientId(@Param("marketingId") Long marketingId, @Param("clientId") String clientId);

    /**
     * 查询邀请有礼邀请记录
     *
     * @param type
     * @param clientId
     * @return
     */
    List<ClientActivityVO> findByMarketingIdAndClientId(@Param("marketingId") Long marketingId, @Param("clientId") String clientId);

    /**
     * 统计参加活动
     *
     * @param marActivityClient
     * @return
     */
    int count(MarActivityClient marActivityClient);

    /**
     * 获取奖励排行榜
     *
     * @param marketingId
     * @return
     */
    List<MarActivityClient> getRewardsRank(Long marketingId);
}




